var app = getApp();
Page({
  data: {
      products:{},
  },
  onLoad: function () {
      console.log("style onLoad ...")
    var that = this
    app.ajaxJson('/product/list', {}, function(res){
        var json = res.data;
        if(json.code != 200){
            return;
        }
        that.setData({
            products:json.data
        });
    });
  },
  //事件处理函数
  bindViewTap: function(e) {
      var param = e.currentTarget.dataset;
      var id = param["id"];
      wx.navigateTo({
          url: '../detail/detail?id='+id
      })
  }
})